class Stack(object):
    def __init__(self):
        self.items = []  # 空列表

    def push(self, item):
        self.items.append(item)

    def pop(self):
        return self.items.pop()

    def peek(self):
        return self.items[len(self.items) - 1]

    def isEmpty(self):
        return self.items == []

    def size(self):
        return len(self.items)


def main():
    s = Stack()
    s.push("a")
    s.push("b")
    print(s.items)  # ['a', 'b']
    print(s.pop())  # b
    print(s.peek())  # a
    print(s.isEmpty())  # False
    print(s.size())  # 1


if __name__ == '__main__':
    main()
